{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "s = set()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "s.add(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{3}"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "s.remove(3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "set()"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/design-hashset/\n",
    "\n",
    "\n",
    "Runtime: 144 ms, faster than 91.82% of Python3 online submissions for Design HashSet.\n",
    "Memory Usage: 19.1 MB, less than 52.56% of Python3 online submissions for Design HashSet.\n",
    "\n",
    "\n",
    "```python\n",
    "class MyHashSet:\n",
    "\n",
    "    def __init__(self):\n",
    "        \"\"\"\n",
    "        Initialize your data structure here.\n",
    "        \"\"\"\n",
    "        self.set = set()\n",
    "\n",
    "    def add(self, key: int) -> None:\n",
    "        self.set.add(key)\n",
    "\n",
    "    def remove(self, key: int) -> None:\n",
    "        try:\n",
    "            self.set.remove(key)\n",
    "        except Exception:\n",
    "            pass\n",
    "\n",
    "    def contains(self, key: int) -> bool:\n",
    "        \"\"\"\n",
    "        Returns true if this set contains the specified element\n",
    "        \"\"\"\n",
    "        return key in self.set\n",
    "```\n",
    "\n",
    "3 minutes\n",
    "\n",
    "2 shoot"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
